/*
 * Licensed this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.boapi.person;

/**
 * <span lang='en'>Identity document</span>
 * <span lang='de'>Identitätsnachweis</span>
 * <span lang='es'>Documento de identidad</span>
 * 
 * @author Sebastian Ritter
 * @version 1.0.0.0
 */
public class PersonalIdentityCardFactory {
	
	/**
	 * Class factory contructor not visible.
	 */
	private PersonalIdentityCardFactory(){};

	/**
	 * Create a new identity document.
	 * @param twoLetterISO3166CountryCode
	 * @return identity document
	 */
	public static IIdentityDocument createIdentityDocumentInstance (final String twoLetterISO3166CountryCode) {
		IIdentityDocument instance = null;
		try {
		  instance = new SimplePersonalIdentityCardImpl (twoLetterISO3166CountryCode);
		}
		catch (IllegalArgumentException notSupported) {
			throw new RuntimeException (notSupported);
		}
		return instance;
	}
	
	/**
	 * Create an new documento nacional de identidad instance for Espania.
	 * @return Documento nacional de identidad 
	 */
	public static IIdentityDocument createSpanishDocumentoNacionalDeIdentidadInstance () {
		return createIdentityDocumentInstance("ES");
	}
}
